/****************************************************************************

 XDV Game Engine
 Copyright 2013 - Xavier Durand-Hollis, David Ward, Vitor Makoto Matayoshi
 
 XDVComponent.h - Created May 30, 2013 by Xavier

 ****************************************************************************/

#ifndef XDVCOMPONENT_H_
#define XDVCOMPONENT_H_

class XDVGameObject;

#include "../GameObject/XDVGameObject.h"
#include <vector>
#include <string>
#include <typeinfo>

/*
 * Base Component class.
 *
 * Instead of being able ot get other components from a component (requires redefinition of methods)
 * you must call GetGameObject().GetComponent(...)
 *
 * Component group registration. ...
 *
 * When instantiating a component, it will be given a name by which it is recognized
 *
 */

class XDVComponent
{
public:
	virtual ~XDVComponent();

	bool IsActive(){ return m_active; }
	void SetActive(bool b){ m_active = b; }

	XDVGameObject* GetGameObject() const{ return m_gameObject; }
	void SetGameObject(XDVGameObject& gameObject){ m_gameObject = &gameObject; }

	std::string GetName(){ return m_componentName; }

protected:
	XDVComponent(std::string name);

private:
	std::string m_componentName;
	bool m_active;
	XDVGameObject* m_gameObject;

};

#endif /* XDVCOMPONENT_H_ */
